<?php

function oh_sql_connect()
{
	$con=new mysqli(OH_DB_HOST,OH_DB_USER,OH_DB_PASS,OH_DB);
	// Check connection
	if (mysqli_connect_errno($con))
	{
		echo "Failed to connect to MySQL: " . mysqli_connect_error();
		die;
	}
	if(!$con->set_charset('utf8'))
	{
		echo "Failed to set UTF8 charset: " . $con->error;
		die;
	}
return $con;
}

function oh_sql_query($con,$sql)
{
	if(OH_SQL_DEBUG==1)
	{
		echo "<br>".$sql."<br>";
	}
	if(($result=$con->query($sql)) == FALSE)
	{
		echo "Failed to execute query: " . $sql . $con->error;
		die;
	}
	
	return $result;
}



?>